﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GoodTeacher.aspx.cs" Inherits="Credit_Teacher_Reprots_GoodTeacher" %>

<%@ Register Src="../../../Custom/SchoolYear.ascx" TagName="SchoolYear"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../../Common/css/main.css" rel="stylesheet" type="text/css" />
</head>
<body SCROLL="no">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div class="pageBody">
            <div class="mainWarp" style="height: 85%; padding-top: 5px; padding-left: 5px;">
                <div style="display: none;">
                    <asp:TextBox ID="txtSchoolYear" runat="server"></asp:TextBox>
                    <asp:TextBox ID="txtTerm" runat="server"></asp:TextBox>
                    <asp:Button ID="btnFlash" runat="server" Text="Button" OnClick="btnFlash_Click"/>
                </div>
                <table>
                    <tr>
                        <td style="padding-left: 4px;" colspan="2">
                            <uc1:SchoolYear ID="ucSchoolYear" runat="server" />
                            <!--学年学期：<select ><option>2009-2010上学期</option><option>2009-2月</option><option>2009-3月</option></select>
                </td>
                <td  style="padding-left:4px;">
                    <select ><option>2009-1月</option><option>2009-2月</option><option>2009-3月</option></select>
                    -->
                        </td>

                        <td style="padding-left: 10px;">
                            <input id="Button1" type="button" value="查询" class="commonBut" style="display: block;"
                                onclick="OnView()" />
                        </td>
                        <td style="padding-left: 10px;">
                            <input id="Button2" type="button" value="导出Excel" class="commonBut" style="display: block;"
                                onclick="getExcel()" />
                        </td>
                    </tr>
                </table>
                <br />
                <div style="overflow-y: auto; overflow-x: none; height: 98%;">
                    <asp:UpdatePanel ID="upResult" runat="server">
                        <ContentTemplate>
                            <asp:Table ID="tbResult" runat="server" CssClass="useList1" Style="margin-left: 5px;">
                            </asp:Table>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnFlash" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>
        </div>
    </form>
    <div id="upInputPop" class="layoutWarp" style="display: none">
        <iframe src="" name="downloadf" id="downloadf" style="height: 80%;width: 95%;overflow-y:auto;overflow-x:none;" frameborder="0"   ></iframe>
    </div>
</body>

<script type="text/javascript" src="../../Common/js/TableForExport.js"></script>
<script type="text/javascript">
    function OnView(){
        document.getElementById('<%=txtSchoolYear.ClientID %>').value = GetCurrentYear;
        document.getElementById('<%=txtTerm.ClientID %>').value = GetCurrentTerm;
        document.getElementById('<%=btnFlash.ClientID %>').click();
    }

    function getExcel() {
        var cells = GetTableInfo(document.getElementById("tbResult"));
        if(cells!=null)
        {            
            PageMethods.GetExcel(cells,function(result){
            document.getElementById('downloadf').src = "";
            document.getElementById('downloadf').src = "../../../PostFileBytes.aspx";
            },function(err){alert(err._message);});
        }
    }
</script>

</html>
